﻿@model Model.GroupInfo
@{
    ViewBag.Title = "UserGroupAdd";
    Layout = "~/Views/Shared/MP.cshtml";
}
<script src="~/Scripts/Yun/UserGroup.js"></script>
<body class="errorpage">
    <div class="stdform">
        <div class="maincontent">
            <div class="maincontentinner">
                <div class="widget">
                    <h4 class="widgettitle">添加用户组</h4>
                    <div class="widgetcontent">
                        @using( Html.BeginForm( "UserGroupAdd", "UserGroup", FormMethod.Post, new { enctype = "multipart/form-data" } ) )
                        {
                            @Html.ValidationSummary( true )
                            @Html.HiddenFor( a => a.GroupId )
                            @Html.HiddenFor( a => a.CreateTime )
                            
                            <div class="par2 control-group">
                                <div class="label-left">
                                    用户组名称
                                </div>
                                <div class="controls">
                                    @Html.TextBoxFor( a => a.GroupName, new { @class = "input1" } )
                                    <span style="color: red">*</span>
                                    @Html.ValidationMessageFor( a => a.GroupName )
                                </div>
                            </div>
                            <div class="par2 control-group">
                                <div class="label-left">
                                    用户组备注
                                </div>
                                <div class="controls">
                                    @Html.TextAreaFor( a => a.GroupNote, new { @class = "TextArea1" } )
                                </div>
                            </div>
                            <div class="par3 control-group oh">
                                <div class="label-left">
                                    用户组成员
                                </div>
                                <div class="controls" style="float:left; max-width:80%">
                                    <input id="UserHid" name="UserHid" type="hidden" value="@ViewBag.GroupUserStr" />
                                    <div class="UserSelect">
                                        @if( ViewBag.GroupUser != null )
                                        {
                                            foreach( var item in ViewBag.GroupUser )
                                            {
                                                <div id="UserSe@(item.UserId)" class="btn userGroup2">
                                                    @(item.UserName)
                                                    <span onclick="delGroupUser(this)">
                                                        <img src="/Content/Img/Usercha.png">
                                                    </span>
                                                </div>
                                            }
                                        }
                                    </div>
                                    <div class="btn" onclick="AddUserLaryer()">添加人员</div>
                                </div>
                            </div>
                            <p class="stdformbutton" style=" margin-left:120px;">
                                <input class="btn" type="submit" style="display:inline-block;" onclick="return Add()" value="提交" />
                                <input class="btn" type="submit" style="display:inline-block;" onclick=" location.href = 'UserGroupList'; return false;" value="返回" />
                            </p>
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="popup_overlay"></div>
    <div id="popup_container"></div>
</body>